home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / AmigaTalk_X / intuition / GadgetFlags.st < prev    next >
Encoding:
Text File  |  2002-03-13  |  2.5 KB  |  67 lines

  1. " -------------------------------------------------------------------- "
  2. " GadgetFlags Class is a Singleton class that allows the user to       "
  3. " reference Gadget Flags without having to remember their actual       "
  4. " hexadecimal values.                                                  "
  5. ""
  6. " The User does NOT need to create one of these, since Intuition Class "
  7. " will instantiate the only needed instance of this Class.  See the    "
  8. " SetupIntuition.st source file for the method(s) that help the User   "
  9. " with this Class.                                                     "
  10. ""
  11. " ALL singleton classes MUST contain the following:                    "
  12. ""
  13. "   the methods:  isSingleton AND privateSetup     AND                 "
  14. "                 uniqueInstance Class instance variable.              "
  15. " -------------------------------------------------------------------- "
  16.  
  17. Class GadgetFlags :Dictionary ! uniqueInstance ! 
  18. [
  19.    isSingleton
  20.      ^ true  
  21. |  
  22.    privateNew ! newinstance !
  23.      newinstance <- super new.
  24.  
  25.      ^ newinstance
  26. |
  27.    new
  28.      ^ (self privateSetup)
  29. |
  30.    privateSetup
  31.      (uniqueInstance isNil)
  32.        ifTrue: [uniqueInstance <- self privateNew.
  33.  
  34.                 " Describe the highlight technique to be used:"
  35.  
  36.                 self at: #GFLG_GADGHCOMP    put: 0.
  37.                 self at: #GFLG_GADGHIGHBITS put: 3. "2r0011 For masking."
  38.                 self at: #GFLG_GADGHBOX     put: 1.
  39.                 self at: #GFLG_GADGHIMAGE   put: 2.
  40.                 self at: #GFLG_GADGHNONE    put: 3.
  41.  
  42.                 self at: #GFLG_GADGIMAGE    put: 4.
  43.  
  44.                 self at: #GFLG_RELBOTTOM    put: 8.
  45.                 self at: #GFLG_RELRIGHT     put: 16r10.
  46.                 self at: #GFLG_RELWIDTH     put: 16r20.
  47.                 self at: #GFLG_RELHEIGHT    put: 16r40.
  48.  
  49.                 self at: #GFLG_SELECTED     put: 16r80.
  50.  
  51.                 self at: #GFLG_DISABLED     put: 16r100.
  52.                 self at: #GFLG_TABCYCLE     put: 16r200.
  53.                 self at: #GFLG_STRINGEXTEND put: 16r400.
  54.                 self at: #GFLG_IMAGEDISABLE put: 16r800.
  55.  
  56.                 self at: #GFLG_LABELMASK    put: 16r3000. "For masking."
  57.                 self at: #GFLG_LABELITEXT   put: 0.
  58.                 self at: #GFLG_LABELSTRING  put: 16r1000.
  59.                 self at: #GFLG_LABELIMAGE   put: 16r2000.
  60.  
  61.                 self at: #GFLG_RELSPECIAL   put: 16r4000.
  62.                 self at: #GFLG_EXTENDED     put: 16r8000.
  63.                ].
  64.                 
  65.      ^ self "uniqueInstance??"
  66. ]
  67.